package com.zy.dp.prototype.example4;

public class PersonalOrder implements Cloneable, OrderApi
{

	private String customeName;
	private Product product = null;
	private int orderProductNum = 0;

	public String getCustomeName()
	{
		return customeName;
	}

	public void setCustomeName(String customeName)
	{
		this.customeName = customeName;
	}

	public Product getProduct()
	{
		return product;
	}

	public void setProduct(Product product)
	{
		this.product = product;
	}

	@Override
	public int getOrderProductNum()
	{
		return this.orderProductNum;
	}

	@Override
	public void setOrderProductNum(int num)
	{
		this.orderProductNum = num;

	}

	@Override
	protected Object clone()
	{

		PersonalOrder obj = null;

		try
		{
			obj = (PersonalOrder) super.clone();
			obj.setProduct((Product) this.product.clone());
		}
		catch (CloneNotSupportedException e)
		{
			e.printStackTrace();
		}

		return obj;

	}

	@Override
	public String toString()
	{
		return "订购产品是=" + this.product.getName() + ",订购数量为="
				+ this.orderProductNum;

	}
}
